﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using YouMa.Reposity;

namespace YouMa.Controllers
{
    [Produces("application/json")]
    [Route("api/Theme")]
    public class ThemeController : Controller
    {
        private readonly ThemeReposity ThemeReposity;
        public ThemeController(ThemeReposity _ThemeReposity)
        {

            ThemeReposity = _ThemeReposity;
        }

        /// <summary>
        /// 获取用户关注的主题列表
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        [HttpGet,Route("GetGZThemeList")]
        public IActionResult GetGZThemeList(int userid)
        {
            var list = ThemeReposity.GetGZTheList(userid);
            if (list != null && list.Count > 0)
            {
                return Ok(new { msg = "获取列表成功", isSuccess = true });
            }
            return Ok(new { msg = "获取列表失败", isSuccess = false });
        }
    }
}